Skip to content

feat: organized-pool context, archive introspection, matching config - #13

Merged
zackkitzmiller merged 5 commits into
mainfrom
feat/organized-ledger
Jun 16, 2026
Merged

feat: organized-pool context, archive introspection, matching config#13
zackkitzmiller merged 5 commits into
mainfrom
feat/organized-ledger

Conversation

@zackkitzmiller

Copy link
Copy Markdown
Member

Summary

  • Organized-pool context: When grouping new files, the AI receives rich descriptions (summaries + tags) from up to 5 sample files per existing group, enabling accurate matching even with very few new files
  • Archive introspection: ZIP files are extracted to a temp dir and inner files are analyzed individually through the full AI pipeline, then synthesized into a single description (respects max file count and max file size limits)
  • Config toggles: Both features default to on via [matching] config section; disable with --no-organized-context or --no-introspect-archives CLI flags

Changes

  • src/config.rs — New MatchingConfig struct with use_organized_context, introspect_archives, max_archive_files, max_archive_file_size_mb; CLI flags --no-organized-context and --no-introspect-archives
  • src/analyze/mod.rsanalyze_archive(), extract_and_analyze_archive(), extract_zip() for archive introspection with recursive analysis via Box::pin
  • src/ai/prompts.rsgroup_organized_context() builds rich prompt section with sample file summaries/tags per group
  • src/ai/mod.rspropose_groups_with_organized_context() trait method with default impl
  • src/ai/claude.rsClaudeProvider override using organized context in grouping prompt
  • src/ledger/mod.rsgroup_content_hashes() returns blake3 hashes per group for cache lookups
  • src/pipeline.rsload_organized_context() loads cached descriptions; wired through run_ai_pipeline
  • New deps: zip = "2", tempfile = "3" (promoted from dev-only)

Test plan

  • 332 tests pass (cargo test)
  • cargo clippy clean
  • cargo fmt --check clean
  • Config: MatchingConfig defaults, TOML parsing, CLI flag overrides (7 new tests)
  • Ledger: group_content_hashes returns/filters correctly (2 new tests)
  • Prompts: group_organized_context empty/populated/truncation (3 new tests)
  • Archive: extract_zip extracts files, skips hidden/nested, respects max limit (3 new tests)

… multi-select & preview

Track previously organized files in a persistent ledger so re-runs skip them
automatically. New files that are byte-identical to organized content are
flagged as duplicates. Claude results are cached by content hash: per-file
descriptions by file hash, grouping by the full set of file hashes plus
existing folder labels — re-running over an unchanged set sends zero tokens.

Group labels can now be nested paths ("Work/Acme Corp/Website Redesign")
that become real directory trees. Claude is prompted with existing folder
names from the ledger so new files route into matching groups instead of
near-duplicate ones.

TUI gains multi-select (Enter to mark, batch d/m/n) and a spacebar preview
modal for images and text files, reusing the DiffState modal pattern.

Folders containing `.spindel-ignore` are excluded from all scanning.

CLI additions: --no-ledger, --ledger <path>.
Add decode_image() helper that tries the image crate first, then falls
back to ImageMagick `magick convert` for formats the crate can't handle
(e.g. HEIC/HEIF). Replaces four inline decode blocks. Also clears
preview state when no image path is available, and updates test model
references from claude-sonnet-4-20250514 to claude-sonnet-4-6.
…toggles

When grouping new files, the AI now receives rich descriptions (summaries + tags)
from sample files in each existing group — not just bare folder names — so it can
match accurately even with very few new files.

ZIP archives are introspected: inner files are extracted to a temp dir, analyzed
individually through the full AI pipeline, and synthesized into a single description.
Respects configurable limits (max files, max file size per entry).

Both features default to on and can be toggled via [matching] config section or
CLI flags (--no-organized-context, --no-introspect-archives).

New dependencies: zip 2, tempfile 3 (promoted from dev-only).
@ecc-tools

ecc-tools Bot commented Jun 16, 2026

Copy link
Copy Markdown

🔒 Upgrade Required

Private repository analysis requires Pro or Enterprise.

Upgrade: https://ecc.tools/pricing?plan=pro


ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers.

All conflicts were in regions where this branch adds new code
(organized-pool context, archive introspection, matching config)
that main does not have. Kept our side in all cases.
@ecc-tools

ecc-tools Bot commented Jun 16, 2026

Copy link
Copy Markdown

🔒 Upgrade Required

Private repository analysis requires Pro or Enterprise.

Upgrade: https://ecc.tools/pricing?plan=pro


ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers.

@ecc-tools

ecc-tools Bot commented Jun 16, 2026

Copy link
Copy Markdown

🔒 Upgrade Required

Private repository analysis requires Pro or Enterprise.

Upgrade: https://ecc.tools/pricing?plan=pro


ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers.

@zackkitzmiller
zackkitzmiller merged commit 586f613 into main Jun 16, 2026
1 check passed
@zackkitzmiller
zackkitzmiller deleted the feat/organized-ledger branch June 16, 2026 16:24
zackkitzmiller added a commit that referenced this pull request Jun 16, 2026
…13)

* feat: persistent organized ledger, grouping cache, nested labels, TUI multi-select & preview

Track previously organized files in a persistent ledger so re-runs skip them
automatically. New files that are byte-identical to organized content are
flagged as duplicates. Claude results are cached by content hash: per-file
descriptions by file hash, grouping by the full set of file hashes plus
existing folder labels — re-running over an unchanged set sends zero tokens.

Group labels can now be nested paths ("Work/Acme Corp/Website Redesign")
that become real directory trees. Claude is prompted with existing folder
names from the ledger so new files route into matching groups instead of
near-duplicate ones.

TUI gains multi-select (Enter to mark, batch d/m/n) and a spacebar preview
modal for images and text files, reusing the DiffState modal pattern.

Folders containing `.spindel-ignore` are excluded from all scanning.

CLI additions: --no-ledger, --ledger <path>.

* fix: HEIC/HEIF image preview via magick fallback, update test model refs

Add decode_image() helper that tries the image crate first, then falls
back to ImageMagick `magick convert` for formats the crate can't handle
(e.g. HEIC/HEIF). Replaces four inline decode blocks. Also clears
preview state when no image path is available, and updates test model
references from claude-sonnet-4-20250514 to claude-sonnet-4-6.

* feat: organized-pool context, archive introspection, matching config toggles

When grouping new files, the AI now receives rich descriptions (summaries + tags)
from sample files in each existing group — not just bare folder names — so it can
match accurately even with very few new files.

ZIP archives are introspected: inner files are extracted to a temp dir, analyzed
individually through the full AI pipeline, and synthesized into a single description.
Respects configurable limits (max files, max file size per entry).

Both features default to on and can be toggled via [matching] config section or
CLI flags (--no-organized-context, --no-introspect-archives).

New dependencies: zip 2, tempfile 3 (promoted from dev-only).

* gitginore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant